package com.ws.q1.service.lmpl;

import com.ws.q1.bean.User;
import com.ws.q1.mapper.UserMapper;
import com.ws.q1.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class Userlmpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    public User login(String name, String pass) {
        return userMapper.login(name,pass);
    }

    @Override
    public int add(String name, String pass, String phone, String tou) {
        return userMapper.add(name, pass,phone,tou);
    }


    @Override
    public Boolean isUsernameExists(String name) {
        return userMapper.isUsernameExists(name);
    }

    @Override
    public List<User> getUsersByName(String name) {
        return userMapper.getUsersByName(name);
    }


    @Override
    public User huixian(Integer id) {
        return userMapper.huixian(id);
    }

    @Override
    public void xiugai(Integer id, User user) {
        user.setId(id);
        userMapper.xiugai(user);
    }


}
